Optimal. Leaf size=157 \[ -\frac {a \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 b^4 d}+\frac {2 a^4 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^4 \sqrt {a+b} d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 b^3 d}-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.33, antiderivative size = 157, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 8, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3936, 4177,
4167, 4083, 3855, 3916, 2738, 214} \begin {gather*} \frac {2 a^4 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^4 d \sqrt {a-b} \sqrt {a+b}}-\frac {a \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 b^4 d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 b^3 d}-\frac {a \tan (c+d x) \sec (c+d x)}{2 b^2 d}+\frac {\tan (c+d x) \sec ^2(c+d x)}{3 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 2738
Rule 3855
Rule 3916
Rule 3936
Rule 4083
Rule 4167
Rule 4177
Rubi steps
\begin {align*} \int \frac {\sec ^5(c+d x)}{a+b \sec (c+d x)} \, dx &=\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d}+\frac {\int \frac {\sec ^2(c+d x) \left (2 a+2 b \sec (c+d x)-3 a \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{3 b}\\ &=-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d}+\frac {\int \frac {\sec (c+d x) \left (-3 a^2+a b \sec (c+d x)+2 \left (3 a^2+2 b^2\right ) \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{6 b^2}\\ &=\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 b^3 d}-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d}+\frac {\int \frac {\sec (c+d x) \left (-3 a^2 b-3 a \left (2 a^2+b^2\right ) \sec (c+d x)\right )}{a+b \sec (c+d x)} \, dx}{6 b^3}\\ &=\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 b^3 d}-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d}+\frac {a^4 \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{b^4}-\frac {\left (a \left (2 a^2+b^2\right )\right ) \int \sec (c+d x) \, dx}{2 b^4}\\ &=-\frac {a \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 b^4 d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 b^3 d}-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d}+\frac {a^4 \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b^5}\\ &=-\frac {a \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 b^4 d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 b^3 d}-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d}+\frac {\left (2 a^4\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^5 d}\\ &=-\frac {a \left (2 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 b^4 d}+\frac {2 a^4 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^4 \sqrt {a+b} d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{3 b^3 d}-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d}+\frac {\sec ^2(c+d x) \tan (c+d x)}{3 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.79, size = 258, normalized size = 1.64 \begin {gather*} \frac {-\frac {24 a^4 \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+\frac {1}{2} \sec ^3(c+d x) \left (9 a \left (2 a^2+b^2\right ) \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+3 a \left (2 a^2+b^2\right ) \cos (3 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+4 b \left (3 a^2+4 b^2-3 a b \cos (c+d x)+\left (3 a^2+2 b^2\right ) \cos (2 (c+d x))\right ) \sin (c+d x)\right )}{12 b^4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 252, normalized size = 1.61
method | result | size |
derivativedivides | \(\frac {-\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {-a -b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 a^{2}+b a +2 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}+\frac {2 a^{4} \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b^{4} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a +b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 a^{2}+b a +2 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}}{d}\) | \(252\) |
default | \(\frac {-\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {-a -b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 a^{2}+b a +2 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}+\frac {2 a^{4} \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b^{4} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a +b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 a^{2}+b a +2 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}}{d}\) | \(252\) |
risch | \(\frac {i \left (3 b a \,{\mathrm e}^{5 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+12 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+12 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 b a \,{\mathrm e}^{i \left (d x +c \right )}+6 a^{2}+4 b^{2}\right )}{3 b^{3} d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{b^{4} d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 b^{2} d}+\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d \,b^{4}}-\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, d \,b^{4}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{b^{4} d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 b^{2} d}\) | \(341\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.41, size = 557, normalized size = 3.55 \begin {gather*} \left [\frac {6 \, \sqrt {a^{2} - b^{2}} a^{4} \cos \left (d x + c\right )^{3} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, a^{2} b^{3} - 2 \, b^{5} + 2 \, {\left (3 \, a^{4} b - a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, {\left (a^{2} b^{4} - b^{6}\right )} d \cos \left (d x + c\right )^{3}}, \frac {12 \, \sqrt {-a^{2} + b^{2}} a^{4} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right )^{3} - 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, a^{2} b^{3} - 2 \, b^{5} + 2 \, {\left (3 \, a^{4} b - a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, {\left (a^{2} b^{4} - b^{6}\right )} d \cos \left (d x + c\right )^{3}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{5}{\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 286 vs.
\(2 (140) = 280\).
time = 0.53, size = 286, normalized size = 1.82 \begin {gather*} \frac {\frac {12 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a^{4}}{\sqrt {-a^{2} + b^{2}} b^{4}} - \frac {3 \, {\left (2 \, a^{3} + a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{4}} + \frac {3 \, {\left (2 \, a^{3} + a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{4}} - \frac {2 \, {\left (6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3} b^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.45, size = 1021, normalized size = 6.50 \begin {gather*} -\frac {\frac {9\,a^4\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {8\,a^6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a^8\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+b^6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+8\,a^7\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,a\,b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a^5\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+5\,a^2\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a^3\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+8\,a^4\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,\left (4\,a^4\,\left (a^2-b^2\right )+b^4\,\left (a^2-b^2\right )+2\,a^5\,b-4\,a^6+2\,a^3\,b^3+4\,a^2\,b^2\,\left (a^2-b^2\right )-a\,b^3\,\left (a^2-b^2\right )-2\,a^3\,b\,\left (a^2-b^2\right )\right )}\right )}{2}-\frac {3\,b^3\,\sin \left (c+d\,x\right )\,\sqrt {a^2-b^2}}{2}-\frac {b^3\,\sin \left (3\,c+3\,d\,x\right )\,\sqrt {a^2-b^2}}{2}+\frac {3\,a^4\,\cos \left (3\,c+3\,d\,x\right )\,\mathrm {atanh}\left (\frac {8\,a^6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a^8\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+b^6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+8\,a^7\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,a\,b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a^5\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+5\,a^2\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )-8\,a^3\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )+8\,a^4\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,\left (4\,a^4\,\left (a^2-b^2\right )+b^4\,\left (a^2-b^2\right )+2\,a^5\,b-4\,a^6+2\,a^3\,b^3+4\,a^2\,b^2\,\left (a^2-b^2\right )-a\,b^3\,\left (a^2-b^2\right )-2\,a^3\,b\,\left (a^2-b^2\right )\right )}\right )}{2}+\frac {3\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )\,\sqrt {a^2-b^2}}{2}-\frac {3\,a^2\,b\,\sin \left (c+d\,x\right )\,\sqrt {a^2-b^2}}{4}+\frac {9\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {a^2-b^2}}{2}+\frac {3\,a\,b^2\,\sin \left (2\,c+2\,d\,x\right )\,\sqrt {a^2-b^2}}{4}-\frac {3\,a^2\,b\,\sin \left (3\,c+3\,d\,x\right )\,\sqrt {a^2-b^2}}{4}+\frac {9\,a\,b^2\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {a^2-b^2}}{4}+\frac {3\,a\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )\,\sqrt {a^2-b^2}}{4}}{3\,b^4\,d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )\,\sqrt {a^2-b^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________